home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0705.dms / q0705.adf / Amiga / Appendices / GuruMeditation.doc < prev    next >
Text File  |  1992-07-29  |  8KB  |  273 lines

  1. 6    GURU-MEDITATION
  2.  
  3. 6.1  INTRODUCTION
  4.  
  5. If you have been programming the Amiga for a while you have
  6. most certainly seen your nice Amiga blow up in front of your
  7. eyes. However, the Amiga is a nice computer, and if it crashes
  8. it will try to do that as neatly as possible. You are usually
  9. (!) allowed to save any important files, and when the Amiga
  10. goes down it will give you a last message, trying to tell you
  11. what went wrong.
  12.  
  13. Many programmers have not realized how important that last
  14. message is. For them, it is just a collection of strange
  15. numbers. But those numbers can actually tell you what exactly
  16. went wrong, and once you know what went wrong, it is usually
  17. no problem to find the bug.
  18.  
  19.  
  20.  
  21. 6.2  AMIGA CRASHING
  22.  
  23. When the Amiga is crashing it happens that the Exec have
  24. realized that something will go wrong and halted that task.
  25. Exec will then open a System requester with a warning message:
  26.  
  27.   --------------------------------
  28.   |  Software error - task held  |
  29.   |   Finish all disk activity   |
  30.   | Select CANCEL to reset/debug |
  31.   |                              |
  32.   | ---------         ---------- |
  33.   | | Retry |         | Cancel | |
  34.   | ---------         ---------- |
  35.   --------------------------------
  36.  
  37. You can then save any important files to a disk before you
  38. answer the requester (once you have pressed CANCEL the Guru
  39. will visit you!). Important, since the Amiga is in trouble
  40. it can crash any second, and if you were saving anything onto
  41. a disk at that moment, the disk may become corrupted, and all
  42. data lost. The best solution is to have an empty emergency
  43. disk that you only use when the Amiga is upset. Sometimes the
  44. Exec have not been able to halt the task, and the Guru will
  45. immediately visit you.
  46.  
  47.  
  48.  
  49. 6.3  GURU ALERTS
  50.  
  51. Once the Amiga really crashes, the powerlight will flash for
  52. some seconds, and an Alert will be activated. For example:
  53.  
  54.   ----------------------------------------------------------
  55.   | Software failure! Press left mouse button to continue. |
  56.   |          Guru Meditation   #84010007.00C13870          |
  57.   ----------------------------------------------------------
  58.  
  59. Now you only need to decode the message and you have found
  60. the error. (Advanced programmer can attach a modem to the
  61. Amiga and use a program called ROMWack in order to debug the
  62. computer. But we will not discuss it here.)
  63.  
  64.  
  65.  
  66. 6.4  GURU MEDITATION NUMBERS
  67.  
  68. There exist two different types of Guru Meditation Numbers:
  69.   - CPU Errors (680x0 Processor Traps)
  70.   - System Software Errors
  71.  
  72.  
  73.  
  74. 6.5  CPU ERRORS
  75.  
  76. CPU Errors look like this:
  77.  
  78. Guru Meditation  #0000000x.yyyyyyyy
  79.  
  80. x is one of the following values:
  81.  
  82. 2  Bus Error              Hardware error
  83. 3  Address Error          Word access on odd byte boundary
  84. 4  Illegal Instruction
  85. 5  Divide by zero
  86. 6  CHK Instruction
  87. 7  TRAPV Instruction
  88. 8  Privilege Violation
  89. 9  Trace
  90. A  Opcode 1010 Emulation  Instruction word with a value
  91.                           between A000-AFFF.
  92. B  Opcode 1111 Emulation  Instruction word with a value
  93.                           between F000-FFFF.
  94.  
  95. yyyyyyyy is the address of the task which went wrong. (It
  96. is normally your own program that caused the problem.)
  97.  
  98. If you get a Guru Meditation number like #00000005.00C13870
  99. it means: A program, at the address C13870, tried to devide
  100. a value by zero. Since you now know what the error was you
  101. only need to look at the places where your program can be
  102. forced to devide a value by zero, and it should not take to
  103. long time to find the bug.
  104.  
  105.  
  106.  
  107. 6.6  SYSTEM SOFTWARE ERRORS
  108.  
  109. System Software errors look like this:
  110.  
  111. Guru Meditation  #aabbcccc.dddddddd
  112.  
  113. The first field of the number tells us if the error is a
  114. Recoverable Error or if it is a Dead End Alert. If the error
  115. is a Dead End Alert the number will start with 8 otherwise it
  116. is 0. (The total screen will also be black, while on 
  117. Recoverable Errors the screen is merely pushed down a bit.)
  118.  
  119. The first field of the number tells us also which Device,
  120. Library or Resource went wrong:
  121.  
  122. 01  Exec Library         LIBRARIES
  123. 02  Graphics Library
  124. 03  Layers Library
  125. 04  Intuition Library
  126. 05  Math Library
  127. 06  CList Library
  128. 07  AmigaDOS Library
  129. 08  RAM Handler Library
  130. 09  Icons Library
  131.  
  132. 10  Audio Device         DEVICES
  133. 11  Console Device
  134. 12  GamePort Device
  135. 13  Keyboard Device
  136. 14  Trackdisk Device
  137. 15  Timer Device
  138.  
  139. 20  CIA Resource         RESOURCES
  140. 21  Disk Resource
  141. 22  Misc Resource
  142.  
  143. 30  BootStrap            OTHERS
  144. 31  Workbench
  145. 32  Disk Copy
  146.  
  147. A number like 04 means: Recoverable Error in the Intuition
  148. Library. While a number like 84 means: Fatal Error in
  149. the Intuition Library.
  150.  
  151.  
  152. The second field (bb) of the Guru Meditation number gives
  153. us the general cause of the problem:
  154.  
  155. 01  No Memory
  156. 02  Unable to Create Library
  157. 03  Unable to Open Library
  158. 04  Unable to Open Device
  159. 05  Unable to Open Resource
  160. 06  Input/Output (I/O) Error
  161. 07  No Signal
  162.  
  163. So a number like 8201cccc means a fatal error in the Graphics
  164. Library, the problem was caused by not enough memory.
  165.  
  166.  
  167. The last field (cccc) before the dot gives some more specific
  168. information. Here is a list of some common Guru Meditation
  169. Numbers: (This information is taken form the headerfile
  170. "exec/alerts.h" [V1.3]:)
  171.  
  172. Exec Library:
  173.   01000000
  174.   81000001  68000 exception vector checksum
  175.   81000002  Execbase checksum
  176.   81000003  Library checksum failure
  177.   81000004  No memory to make library
  178.   81000005  Corrupted memory list
  179.   81000006  No memory for interrupt servers
  180.   81000007  InitStruct() of an APTR source
  181.   81000008  A semaphore is in illegal state
  182.   81000009  Freeing memory already freed
  183.   8100000A  Illegal 68k exception taken
  184.  
  185.  
  186. Graphics Library:
  187.   02000000
  188.   82010000  Graphics out of memory
  189.   82010006  Long frame, no memory
  190.   82010007  Short frame, no memory
  191.   02010009  Text, no memory for TmpRas
  192.   8201000A  BltBitMap, no memory
  193.   8201000B  Regions, memory not available
  194.   82010030  MakeVPort, no memory
  195.   82011234  Emergency memory not available *
  196.  
  197.  
  198. Layers Library:
  199.   03000000
  200.   83010000  Layers out of memory
  201.  
  202.  
  203. Intuition Library:
  204.   04000000
  205.   84000001  Unknown gadet type
  206.   04000001  Recovery form of AN_GadgetType
  207.   84010002  Create port, no memory
  208.   04010003  Item plane alloc, no memory
  209.   04010004  Sub alloc, no memory
  210.   84010005  Plane alloc, no memory
  211.   84000006  Item box top < RelZero
  212.   84010007  Open screen, no memory
  213.   84010008  Open screen, raster alloc, no memory
  214.   84000009  Open sys screen, unknown type
  215.   8401000A  Add SW gadgets, no memory
  216.   8401000B  Open window, no memory
  217.   8400000C  Bad State Return entering Intuition
  218.   8400000D  Bad Message received by IDCMP
  219.   8400000E  Weird echo causing incomprehension
  220.   8400000F  Couldn't open the Console Device
  221.  
  222.  
  223. Amiga DOS Library:
  224.   07000000
  225.   07010001  No memory at startup
  226.   07000002  EndTask didn't
  227.   07000003  Qpkt failure
  228.   07000004  Unexpected packet received
  229.   07000005  Freevec failed
  230.   07000006  Disk block sequence error
  231.   07000007  Bitmap corrupt
  232.   07000008  Key already free
  233.   07000009  Invalid checksum
  234.   0700000A  Disk Error
  235.   0700000B  Key out of range
  236.   0700000C  Bad overlay
  237.  
  238.  
  239. RAM Library:
  240.   08000000
  241.   08000001  No overlays in library seglists
  242.  
  243.  
  244. Trackdisk Device:
  245.   14000000
  246.   14000001  Calibrate: seek error
  247.   14000002  Delay: error on timer wait
  248.  
  249.  
  250. Timer Device:
  251.   15000000
  252.   15000001  Bad request
  253.   15000002  Power supply does not supply ticks
  254.  
  255.  
  256. Disk Resourcek.resource:
  257.   21000000
  258.   21000001  Get unit: already has disk
  259.   21000002  Interrupt: no active unit
  260.  
  261.  
  262. BootStrap:
  263.   30000000
  264.   30000001  Boot code returned an error
  265.  
  266.  
  267. The number after the dot (dddddd dd) can be three things:
  268. 1. Address of the task which went wrong.
  269. 2. If the error occured because of some sort of memory
  270.    allocation/deallocation, it is the address of that memory
  271.    block.
  272. 3. If Exec is realy confused the number is 48454C50, which
  273.    stands for HELP. (48=H, 45=E, 4C=L, 50=P)